<template>
  <div class="myhead">
    <div @click="goback" class="hback"></div>
    <p class="app">下载app</p>
    <van-icon @click="toSearch" name="search" class="search" size="26" />
  </div>
</template>

<script>
export default {
  methods: {
    toSearch() {
      // if (this.$route.name == "search") return false;
      if (this.$route.path == "/search") return false;
      console.log(this.$route, "12312");
      this.$router.push("/search");
    },
    goback() {
      this.$router.history.go(-1);
    },
  },
};
</script>

<style lang="less" scoped>
@import "styles/index.less";
.myhead {
  position: fixed;
  z-index: 8;
  left: 0;
  top: 0;
  .w(375);
  .h(82);
  border-bottom: 0.5px solid #e0e0e0;
  background: url(https://static2-qianqian.91q.com/client/img/e2d06f4.jpg) #fff
    50% no-repeat;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  .hback {
    position: absolute;
    .top(20);
    .left(20);
    .w(100);
    .h(42);
    // background: red;
  }
  .app {
    position: fixed;
    font-size: 13px;
    height: 8vw;
    line-height: 8vw;
    z-index: 102;
    top: 7vw;
    right: 19vw;
    display: block;
    font-style: normal;
    padding: 0 10px;
    border-radius: 2px;
    color: #fafafa;
    opacity: 0.9;
    background-color: #e02b2b;
  }
  .search {
    .margin-left(300);
    .margin-top(4);
  }
}
</style>
